package Java.com;

public class swappingExample {
	public static void main(String[] args) {
		int a = 30;
		int b = 45;
		System.out.println("Before swapping，a= " + a + " and b= " + b);

		/**
		 * 調用交換方法
		 */
		swapFunction(a, b);
		System.out.println("Now,Before After swapping values will be same here:");
	}

	public static void swapFunction(int a, int b) {
		System.out.println("Before swapping(inside)，a= " + a + " b= " + b);
		/**
		 * 交換n1和n2
		 */
		int c = a;
		a = b;
		b = c;
		System.out.println("After swapping(Inside)，a= " + a + " b = " + b);
	}
}